package com.huilian.iotbox.admin.wap.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.huilian.iotbox.admin.wap.dao.StmtResultDao;
import com.huilian.iotbox.admin.wap.service.StmtResultService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.dto.StmtResultDto;
import com.huilian.iotbox.data.vo.StmtResultVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zengxilin
 * @CreateDate: 2021-10-04 11:52
 * @Description:
 */
@Service
public class StmtResultServiceImpl implements StmtResultService {
    @Resource
    private StmtResultDao stmtResultDao;

    @Override
    public ServerResponse findStmtResultList(StmtResultDto stmtResultDto) {
        PageHelper.startPage(stmtResultDto.getPageNum(), stmtResultDto.getPageSize(), "sr.stmtDate desc");
        List<StmtResultVo> stmtResultVoList = stmtResultDao.findStmtResultList(stmtResultDto);
        PageInfo pageInfo = new PageInfo<>(stmtResultVoList);
        return ServerResponse.createBySuccess(pageInfo);
    }
}
